import 'package:p_location/home/obj/person_image_info.dart';

class EmployeeInfoObj {
  String address;
  String birthday;
  String cardNumber;
  String census;
  String censusRegister;
  String censusRegisterArea;
  String censusRegisterCity;
  String censusRegisterProvince;
  List<Object> certificateIds;
  List<Object> certificateListBeans;
  String code;
  int createBy;
  String createTime;
  String deleteFlag;
  int departId;
  String departName;
  int education;
  String educationName;
  String extFields;
  String flag;
  String gender;
  int healthStatus;
  String healthStatusName;
  int iconId;
  int id;
  int idCardImgId;
  String idCardName;
  String idCardNo;
  int idCardType;
  PersonImageInfo image;
  int job;
  String jobDuty;
  String jobHistory;
  String jobName;
  String joinWorkDate;
  String major;
  int nation;
  String nationName;
  String oldName;
  String orgCode;
  String personTemplate;
  int personTemplateId;
  String personTemplateName;
  String personnelType;
  String postcode;
  String realName;
  int role;
  String roleName;
  String sn;
  String telephone;
  int tenentId;
  String title;
  int updateBy;
  String updateTime;
  String url;
  String work;
  String workAt;
  String workAtArea;
  String workAtCity;
  String workAtProvince;
  String workCompany;
  int workCompanyId;
  String workType;
  int workTypeId;
  String workTypeName;

  EmployeeInfoObj(
      {this.address,
      this.birthday,
      this.cardNumber,
      this.census,
      this.censusRegister,
      this.censusRegisterArea,
      this.censusRegisterCity,
      this.censusRegisterProvince,
      this.certificateIds,
      this.certificateListBeans,
      this.code,
      this.createBy,
      this.createTime,
      this.deleteFlag,
      this.departId,
      this.departName,
      this.education,
      this.educationName,
      this.extFields,
      this.flag,
      this.gender,
      this.healthStatus,
      this.healthStatusName,
      this.iconId,
      this.id,
      this.idCardImgId,
      this.idCardName,
      this.idCardNo,
      this.idCardType,
      this.image,
      this.job,
      this.jobDuty,
      this.jobHistory,
      this.jobName,
      this.joinWorkDate,
      this.major,
      this.nation,
      this.nationName,
      this.oldName,
      this.orgCode,
      this.personTemplate,
      this.personTemplateId,
      this.personTemplateName,
      this.personnelType,
      this.postcode,
      this.realName,
      this.role,
      this.roleName,
      this.sn,
      this.telephone,
      this.tenentId,
      this.title,
      this.updateBy,
      this.updateTime,
      this.url,
      this.work,
      this.workAt,
      this.workAtArea,
      this.workAtCity,
      this.workAtProvince,
      this.workCompany,
      this.workCompanyId,
      this.workType,
      this.workTypeId,
      this.workTypeName});

  factory EmployeeInfoObj.fromJson(Map<String, dynamic> json) {
    return EmployeeInfoObj(
      address: json['address']??"",
      birthday: json['birthday'],
      cardNumber: json['cardNumber'],
      census: json['census'],
      censusRegister: json['censusRegister'] ?? "",
      censusRegisterArea: json['censusRegisterArea'],
      censusRegisterCity: json['censusRegisterCity'],
      censusRegisterProvince: json['censusRegisterProvince'],
//            certificateIds: json['certificateIds'] != null ? (json['certificateIds'] as List).map((i) => Object.fromJson(i)).toList() : null,
//            certificateListBeans: json['certificateListBeans'] != null ? (json['certificateListBeans'] as List).map((i) => Object.fromJson(i)).toList() : null,
      code: json['code'],
      createBy: json['createBy'],
      createTime: json['createTime'],
      deleteFlag: json['deleteFlag'],
      departId: json['departId'],
      departName: json['departName'] ?? "",
      education: json['education'],
      educationName: json['educationName'] ?? "",
      extFields: json['extFields'],
      flag: json['flag'],
      gender: json['gender'],
      healthStatus: json['healthStatus'],
      healthStatusName: json['healthStatusName'] ?? "",
      iconId: json['iconId'],
      id: json['id'],
      idCardImgId: json['idCardImgId'],
      idCardName: json['idCardName']??"",
      idCardNo: json['idCardNo'] ?? "",
      idCardType: json['idCardType'],
      image: json['image'] != null
          ? PersonImageInfo.fromJson(json['image'])
          : null,
      job: json['job'],
      jobDuty: json['jobDuty'],
      jobHistory: json['jobHistory'],
      jobName: json['jobName']??"",
      joinWorkDate: json['joinWorkDate'],
      major: json['major']??"",
      nation: json['nation'],
      nationName: json['nationName'] ?? "",
      oldName: json['oldName'] ?? "",
      orgCode: json['orgCode'],
      personTemplate: json['personTemplate'],
      personTemplateId: json['personTemplateId'],
      personTemplateName: json['personTemplateName'],
      personnelType: json['personnelType'],
      postcode: json['postcode'],
      realName: json['realName'] ?? "",
      role: json['role'],
      roleName: json['roleName'] ?? "",
      sn: json['sn'] ?? "",
      telephone: json['telephone']??"",
      tenentId: json['tenentId'],
      title: json['title'],
      updateBy: json['updateBy'],
      updateTime: json['updateTime'],
      url: json['url'],
      work: json['work'],
      workAt: json['workAt'],
      workAtArea: json['workAtArea'],
      workAtCity: json['workAtCity'],
      workAtProvince: json['workAtProvince'],
      workCompany: json['workCompany']??"",
      workCompanyId: json['workCompanyId'],
      workType: json['workType'],
      workTypeId: json['workTypeId'],
      workTypeName: json['workTypeName'],
    );
  }
}
